package com.glzn.springboot03.config;

import com.glzn.springboot03.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author gongjq
 */
@Configuration
public class AdminWebConfig implements WebMvcConfigurer {
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		//静态资源也会拦截
		registry.addInterceptor(new LoginInterceptor())
						.addPathPatterns("/**")
						.excludePathPatterns("/","/login","/wx/*","/css/*","/img/*");
	}
}
